body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f4f8; 
    color: #333;
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin-top: 15px;
    margin-bottom: 5px;
}

.instructions {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
    padding: 0 10px;
}

#tree-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto; 
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border-top: 1px solid #d8e0e8;
    border-bottom: 1px solid #d8e0e8;
    min-height: 300px; 
}

#familyTreeSvg {
    display: block; 
}

.node rect {
    stroke-width: 2px;
    cursor: pointer;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.node-male rect {
    fill: #a7d8f0; 
    stroke: #7f8c8d; 
}
.node-male rect:hover {
    fill: #89c4e0; 
    stroke: #546e7a;
}

.node-female rect {
    fill: #f8c0c8; 
    stroke: #7f8c8d; 
}
.node-female rect:hover {
    fill: #f0a0ac; 
    stroke: #546e7a;
}

.node-unknown rect { 
    fill: #ecf0f1; 
    stroke: #7f8c8d; 
}
.node-unknown rect:hover {
    fill: #bdc3c7; 
    stroke: #546e7a;
}


.node text {
    font-size: 11px; 
    font-family: sans-serif;
    text-anchor: middle;
    dominant-baseline: central; 
    fill: #2c3e50;
    pointer-events: none; 
}

.node .symbol-display {
    font-size: 14px;
    text-anchor: end;
    pointer-events: none;
}

.link {
    fill: none;
    stroke: #7f8c8d;
    stroke-width: 1.5px;
}

.controls {
    margin-top: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.controls button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 18px; 
    font-size: 0.95em; 
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 90%;
    max-width: 320px;
}

.controls button:hover {
    background-color: #2980b9;
}

#openAffirmationsBtn {
    background-color: #2ecc71; 
}
#openAffirmationsBtn:hover {
    background-color: #27ae60;
}
#openIntentionsBtn {
    background-color: #9b59b6; 
}
#openIntentionsBtn:hover {
    background-color: #8e44ad;
}


.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    padding-top: 30px; 
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 20px;
    border: 1px solid #bbb;
    width: 90%; 
    max-width: 450px;
    border-radius: 8px;
    text-align: left; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-top: 0;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1; 
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #34495e;
}

.modal-content input[type="text"],
.modal-content textarea {
    width: calc(100% - 22px); 
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box; 
}

.modal-content textarea {
    resize: vertical;
    min-height: 60px;
}

.modal-content button { 
    background-color: #3498db; 
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    display: block; 
    width: 100%;
    margin-top: 10px;
}
.modal-content button:hover {
    background-color: #2980b9;
}

#saveNodeDetailsButton {
    background-color: #2ecc71;
}
#saveNodeDetailsButton:hover {
    background-color: #27ae60;
}
#saveAffirmationsButton {
    background-color: #2ecc71;
}
#saveAffirmationsButton:hover {
    background-color: #27ae60;
}

#saveIntentionsButton {
    background-color: #9b59b6;
}
#saveIntentionsButton:hover {
    background-color: #8e44ad;
}

.symbol-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.symbol-selector span {
    font-size: 1.8em;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    border: 2px solid transparent;
}

.symbol-selector span:hover {
    background-color: #e0e0e0;
}

.symbol-selector span.selected {
    background-color: #a7d8f0;
    border-color: #3498db;
}